<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web']], function () {
    Route::get('content-list',['as' => 'Home.Page.content', 'uses' => 'HomeController@contentList']);


    Route::group(['prefix'=>'admin'],function(){
        Route::get('login',['as' => 'Admin.Home.login', 'uses' => 'AdminController@login']);
        Route::get('question-list',['as' => 'Admin.Home.questionList', 'uses' => 'AdminController@questionList']);
        Route::get('question-add',['as' => 'Admin.Home.questionAdd', 'uses' => 'AdminController@questionAdd']);
        //新增测试
        Route::get('daka-content-list',['as' => 'Admin.Home.dakaContentList', 'uses' => 'AdminController@dakaContentList']);
        Route::get('answer-list',['as' => 'Admin.Home.answerList', 'uses' => 'AdminController@answerList']);
        Route::get('answer-set',['as' => 'Admin.Home.answerSet', 'uses' => 'AdminController@answerSet']);
        Route::get('daka-content-set',['as' => 'Admin.Home.dakaContentSet', 'uses' => 'AdminController@dakaContentSet']);
        Route::get('user-list',['as' => 'Admin.Home.userList', 'uses' => 'AdminController@userList']);
        Route::get('banner-list',['as' => 'Admin.Home.bannerList', 'uses' => 'AdminController@bannerList']);
        Route::get('banner-set',['as' => 'Admin.Home.bannerSet', 'uses' => 'AdminController@bannerSet']);
        Route::get('feedback-list',['as' => 'Admin.Home.feedbackList', 'uses' => 'AdminController@feedbackList']);
        Route::get('change-pwd',['as' => 'Admin.Home.changePwd', 'uses' => 'AdminController@changePwd']);
        Route::get('classify-list',['as' => 'Admin.Home.classifyList', 'uses' => 'MyLifeController@classifyList']);
        Route::get('content-list',['as' => 'Admin.Home.contentList', 'uses' => 'MyLifeController@contentList']);
        Route::get('content-set',['as' => 'Admin.Home.contentSet', 'uses' => 'MyLifeController@contentSet']);
        Route::get('list-list',['as' => 'Admin.Home.listList', 'uses' => 'MyLifeController@listList']);
        Route::get('contents-list',['as' => 'Admin.Home.contentsList', 'uses' => 'AdminController@contentsList']);
        Route::get('contents-set',['as' => 'Admin.Home.contentsSet', 'uses' => 'AdminController@contentsSet']);


    });

    Route::group(['prefix'=>'api', 'namespace'=>'Api'],function(){

        Route::group(['prefix' => 'admin','namespace'=>'Admin'],function(){
            Route::post('auth/sign-in',['as'=>'Api.Admin.Auth.signInAdmin','uses'=>'AuthController@signInAdmin']);
            Route::post('auth/change-pwd',['as'=>'Api.Admin.Auth.changePassword','uses'=>'AuthController@changePassword']);
            Route::post('daka/setDakaContent',['as'=>'Api.Admin.daka.setDakaContent','uses'=>'DakaController@setDakaContent']);
            Route::post('daka/delDaka',['as'=>'Api.Admin.daka.delDaka','uses'=>'DakaController@delDaka']);
            Route::post('sys/setBanner',['as'=>'Api.Admin.sys.setBanner','uses'=>'SystemController@setBanner']);
            Route::post('sys/delBanner',['as'=>'Api.Admin.sys.delBanner','uses'=>'SystemController@delBanner']);
            Route::get('auth/signOut',['as'=>'Api.Admin.Auth.signOut','uses'=>'AuthController@signOut']);
            Route::post('sys/addClassify',['as'=>'Api.Admin.sys.addClassify','uses'=>'SystemController@addClassify']);
            Route::post('sys/delClassify',['as'=>'Api.Admin.sys.delClassify','uses'=>'SystemController@delClassify']);
            Route::post('sys/setContent',['as'=>'Api.Admin.sys.setContent','uses'=>'SystemController@setContent']);
            Route::post('sys/delContent',['as'=>'Api.Admin.sys.delContent','uses'=>'SystemController@delContent']);
            Route::post('sys/setList',['as'=>'Api.Admin.sys.setList','uses'=>'SystemController@setList']);
            Route::post('sys/delList',['as'=>'Api.Admin.sys.delList','uses'=>'SystemController@delList']);
            Route::post('sys/setContents',['as'=>'Api.Admin.sys.setContents','uses'=>'SystemController@setContents']);
            Route::post('sys/delContents',['as'=>'Api.Admin.sys.delContents','uses'=>'SystemController@delContents']);


        });

        Route::group(['prefix' => 'file'],function(){
            Route::post('upload-img',['as'=>'Api.File.upload','uses'=>'ImageController@upload']);
            Route::get('show-image/{id}',['as'=>'Api.File.showImageById','uses'=>'ImageController@showImageById']);
            Route::post('upload-user-photo',['as'=>'Api.File.uploadUserPhoto','uses'=>'ImageController@uploadUserPhoto']);
        });

    });
});
